<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("basePath", basePath);
String baseInfoJson= (String)request.getAttribute("baseInfoJson");
String diseaseDiagInfoJson= (String)request.getAttribute("diseaseDiagInfoJson");
String respondResultJson= (String)request.getAttribute("respondResultJson");
%>
<link rel="stylesheet" href="${basePath}assets/bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" href="${basePath}assets/css/basic.css"/>
<link rel="stylesheet" href="${basePath}assets/css/coding/list.css"/>
<link rel="stylesheet" href="${basePath}assets/jquery-ui/jquery-ui.css"/>
<link rel="stylesheet" href="${basePath}assets/css/coding/edit_index_info.css"/>
<script type="text/javascript" src="${basePath}assets/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}assets/layer/layer.js"></script>
<script type="text/javascript" src="${basePath}assets/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="${basePath}assets/jquery-ui/jquery-ui.js"></script>
<script type="text/javascript" src="${basePath}assets/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${basePath}assets/jqueryValidate/jquery.validate.js"></script>
<script type="text/javascript" src="${basePath}assets/jqueryValidate/localization/messages_zh.js"></script>
<script type="text/javascript" src="${basePath}assets/js/coding/edit_disease_diag_info.js?<%=Math.random()%>"></script>
<form action="${basePath}medical_record_coding/edit_disease_diag_info"
	method="post" id="diseaseDiagInfoForm">
	<input type="hidden" name="visitGuid" value="${visitGuid }">
	<input type="hidden" value="0" id="diseaseDiagCount" />
	<input type="hidden" id="basePath" value="${basePath }">
	<div style="min-height: 700px;">
		<table style="margin:0 auto;width: 99%" id="diseaseDiagTable">
		
			<thead>
				<tr>
					<td colspan="9">
						<div style="float:right">
							<input type="submit" value="保存" class="btn"> <input
								type="button" value="新增" onclick="layerCreateDiag()"
								class="btn">
						</div>
					</td>
				</tr>
				
				<tr>
					<td class="tdLabel_4" style="width: 13%" >诊断类型</td>
					<td class="tdLabel_4" style="width: 40%">医生诊断编码及描述</td>
					<td class="tdLabel_4" style="width: 15%">疾病分类主干码</td>
					<td class="tdLabel_4" style="width: 8%">入院病情</td>
					<td class="tdLabel_4" style="width: 8%">治疗结果</td>
					<td class="tdLabel_4" style="width: 4%">位序</td>
					<td class="tdLabel_4" style="width: 12%">操作</td>
				</tr>
				<tr>
					<td class="tdLabel_8">
						<span class="outpatientDiagTypeShow">门诊诊断</span>
						<input type="hidden" readonly="readonly" name="outpatientDiagRecord.diagTypeName" value="门诊诊断"/>
						<input type="hidden" name="outpatientDiagRecord.diagTypeCode" value="1"/>
					</td>
					<td class="tdLabel_8">
						<c:if test="${(not empty diseaseDiagInfo.outpatientDiagRecord.diseaseDiagOriginalDesc) and (not empty diseaseDiagInfo.outpatientDiagRecord.diseaseDiagOriginalCode)  }">
							<c:set scope="page" var="outpatientOriginalDiagShow" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseDiagOriginalCode }[${diseaseDiagInfo.outpatientDiagRecord.diseaseDiagOriginalDesc }]"></c:set>
						</c:if>
						
						<c:if test="${(not empty diseaseDiagInfo.outpatientDiagRecord.diseaseDiagOriginalDesc) and (empty diseaseDiagInfo.outpatientDiagRecord.diseaseDiagOriginalCode)  }">
							<c:set scope="page" var="outpatientOriginalDiagShow" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseDiagOriginalDesc }"></c:set>
						</c:if>
						<span class="outpatientOriginalDiagShow">${outpatientOriginalDiagShow}</span>
						<input type="hidden" name="outpatientDiagRecord.diseaseDiagOriginalDesc" style="width: 100%" readonly="readonly" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseDiagOriginalDesc }">
						<input type="hidden" name="outpatientDiagRecord.diseaseDiagOriginalCode" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseDiagOriginalCode }">
						
					</td>
					<td class="tdLabel_8">
						<span class="outpatientDiagShow">${diseaseDiagInfo.outpatientDiagRecord.diseaseDiagCode }</span>
						<input type="hidden" name="outpatientDiagRecord.diseaseDiagName" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseDiagName }">
						<input type="hidden" name="outpatientDiagRecord.diseaseDiagCode" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseDiagCode }">
						
					</td>
					<td class="tdLabel_8" colspan="3">
						<c:forEach varStatus="extraIndex" begin="1" end="6" step="1">
							<c:choose>
								<c:when test="${ fn:length(diseaseDiagInfo.outpatientDiagRecord.diseaseExtraDiagRecords) >= extraIndex.index}">
									<input type="hidden" name="outpatientDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseExtraDiagRecords[extraIndex.index-1].diseaseExtraDiagCode}">
									<input type="hidden" name="outpatientDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseExtraDiagRecords[extraIndex.index-1].diseaseExtraDiagName}">
									<input type="hidden" name="outpatientDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseExtraDiagRecords[extraIndex.index-1].isExtraMainCode}">
									<input type="hidden" name="outpatientDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName" value="${diseaseDiagInfo.outpatientDiagRecord.diseaseExtraDiagRecords[extraIndex.index-1].isExtraMainName}">
								</c:when>
								<c:otherwise>
									<input type="hidden" name="outpatientDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode">
									<input type="hidden" name="outpatientDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName">
									<input type="hidden" name="outpatientDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode">
									<input type="hidden" name="outpatientDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName">
						
								
								</c:otherwise>
							</c:choose>
							
						</c:forEach>
					</td>
					<td class="tdLabel_8">
						<a style="width: 50px;margin-right: 5px;" onclick="layerUpdateOutpatientDiag(this)" class="btn">编辑</a>
					</td>
				</tr>
				<tr>
					<td class="tdLabel_8">
						<span class="mainDiagTypeShow">主要诊断</span>
						<input type="hidden" name="mainDiagRecord.diagTypeName" value="主要诊断"/>
						<input type="hidden" name="mainDiagRecord.diagTypeCode" value="3"/>
					</td>
					<td class="tdLabel_8">
						<c:if test="${(not empty diseaseDiagInfo.mainDiagRecord.diseaseDiagOriginalDesc) and (not empty diseaseDiagInfo.mainDiagRecord.diseaseDiagOriginalCode)  }">
							<c:set scope="page" var="mainDiagOriginalDiagShow" value="${diseaseDiagInfo.mainDiagRecord.diseaseDiagOriginalCode }[${diseaseDiagInfo.mainDiagRecord.diseaseDiagOriginalDesc }]"></c:set>
						</c:if>
						
						<c:if test="${(not empty diseaseDiagInfo.mainDiagRecord.diseaseDiagOriginalDesc) and (empty diseaseDiagInfo.mainDiagRecord.diseaseDiagOriginalCode)  }">
							<c:set scope="page" var="mainDiagOriginalDiagShow" value="${diseaseDiagInfo.mainDiagRecord.diseaseDiagOriginalDesc }"></c:set>
						</c:if>
						<span class="mainDiagOriginalDiagShow">${mainDiagOriginalDiagShow}</span>
						<input type="hidden" name="mainDiagRecord.diseaseDiagOriginalDesc" value="${diseaseDiagInfo.mainDiagRecord.diseaseDiagOriginalDesc}">
						<input type="hidden" name="mainDiagRecord.diseaseDiagOriginalCode" value="${diseaseDiagInfo.mainDiagRecord.diseaseDiagOriginalCode}">
					</td>
					<td class="tdLabel_8">
						<span class="mainDiagShow">${diseaseDiagInfo.mainDiagRecord.diseaseDiagCode }</span>
						<input type="hidden" name="mainDiagRecord.diseaseDiagName" value="${diseaseDiagInfo.mainDiagRecord.diseaseDiagName}">
						<input type="hidden" name="mainDiagRecord.diseaseDiagCode" value="${diseaseDiagInfo.mainDiagRecord.diseaseDiagCode}">
					</td>
					<td class="tdLabel_8">
						<span class="mainDiagInHospitalDiseaseStateShow">${diseaseDiagInfo.mainDiagRecord.inHospitalDiseaseStateName }</span>
						<input type="hidden" name="mainDiagRecord.inHospitalDiseaseStateCode" value="${diseaseDiagInfo.mainDiagRecord.inHospitalDiseaseStateCode }">
						<input type="hidden" name="mainDiagRecord.inHospitalDiseaseStateName" value="${diseaseDiagInfo.mainDiagRecord.inHospitalDiseaseStateName }">
					</td>
					<td class="tdLabel_8">
						<span class="mainDiagTreatResultShow">${diseaseDiagInfo.mainDiagRecord.treatResultName }</span>
						<input type="hidden" name="mainDiagRecord.treatResultCode" value="${diseaseDiagInfo.mainDiagRecord.treatResultCode }">
						<input type="hidden" name="mainDiagRecord.treatResultName" value="${diseaseDiagInfo.mainDiagRecord.treatResultName }">
						<c:forEach varStatus="extraIndex" begin="1" end="6" step="1">
							<c:choose>
								<c:when test="${ fn:length(diseaseDiagInfo.mainDiagRecord.diseaseExtraDiagRecords) >= extraIndex.index}">
									<input type="hidden" name="mainDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode" value="${diseaseDiagInfo.mainDiagRecord.diseaseExtraDiagRecords[extraIndex.index-1].diseaseExtraDiagCode}">
									<input type="hidden" name="mainDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName" value="${diseaseDiagInfo.mainDiagRecord.diseaseExtraDiagRecords[extraIndex.index-1].diseaseExtraDiagName}">
									<input type="hidden" name="mainDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode" value="${diseaseDiagInfo.mainDiagRecord.diseaseExtraDiagRecords[extraIndex.index-1].isExtraMainCode}">
									<input type="hidden" name="mainDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName" value="${diseaseDiagInfo.mainDiagRecord.diseaseExtraDiagRecords[extraIndex.index-1].isExtraMainName}">
						
								</c:when>
								<c:otherwise>
									<input type="hidden" name="mainDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode">
									<input type="hidden" name="mainDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName">
									<input type="hidden" name="mainDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode">
									<input type="hidden" name="mainDiagRecord.diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName">
								</c:otherwise>
							</c:choose>
							
						</c:forEach>
					</td>
					<td class="tdLabel_8">
					</td>
					<td class="tdLabel_8">
						<a style="width: 50px;margin-right: 5px;" onclick="layerUpdateMainDiag(this)" class="btn">编辑</a>
					</td>
				</tr>
			</thead>
			<tbody>
				
			</tbody>
			<tfoot>
				<tr>
					<td class="tdLabel_8">
						<span class="damageAndVenenationDiagTypeShow" style="font-size: 10px">损伤和中毒的外部原因</span>
						<input type="hidden" name="damageAndVenenationDiagRecords[0].diagTypeName" value="损伤和中毒的外部原因"/>
						<input type="hidden" name="damageAndVenenationDiagRecords[0].diagTypeCode" value="7"/>
					</td>
					<td class="tdLabel_8">
						<c:choose>
							<c:when test="${(not empty diseaseDiagInfo.damageAndVenenationDiagRecords) and  fn:length(diseaseDiagInfo.damageAndVenenationDiagRecords) > 0}">
								<c:if test="${(not empty diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagOriginalDesc) and (not empty diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagOriginalCode)  }">
									<c:set scope="page" var="damageAndVenenationDiagOriginalShow" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagOriginalCode }[${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagOriginalDesc }]"></c:set>
								</c:if>
								
								<c:if test="${(not empty diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagOriginalDesc) and (empty diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagOriginalCode)  }">
									<c:set scope="page" var="damageAndVenenationDiagOriginalShow" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagOriginalDesc }"></c:set>
								</c:if>
								<span class="damageAndVenenationDiagOriginalShow">${damageAndVenenationDiagOriginalShow}</span>
								<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseDiagOriginalDesc" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagOriginalDesc}">
								<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseDiagOriginalCode" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagOriginalCode}">
							</c:when>
							<c:otherwise>
								<span class="damageAndVenenationOriginalDiagShow">${damageAndVenenationDiagOriginalShow}</span>
								<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseDiagOriginalDesc">
								<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseDiagOriginalCode">
							</c:otherwise>
						</c:choose>
						
					</td>
					<td class="tdLabel_8">
						<c:choose>
							<c:when test="${(not empty diseaseDiagInfo.damageAndVenenationDiagRecords) and  fn:length(diseaseDiagInfo.damageAndVenenationDiagRecords) > 0}">
								
								
								<span class="damageAndVenenationDiagShow">${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagCode}</span>
								<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseDiagName" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagName }">
								<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseDiagCode" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseDiagCode}">
									
							</c:when>
							<c:otherwise>
								<span class="damageAndVenenationDiagShow"></span>
								<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseDiagName">
								<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseDiagCode">
								
							</c:otherwise>
						</c:choose>
						
						
					</td>
					<td class="tdLabel_8" colspan="3">
						<c:choose>
							<c:when test="${ fn:length(diseaseDiagInfo.damageAndVenenationDiagRecords) > 0}">
								<c:forEach varStatus="extraIndex" begin="1" end="6" step="1">
									<c:choose>
										<c:when test="${ fn:length(diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords) >= extraIndex.index}">
											<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[extraIndex.index-1].diseaseExtraDiagCode}">
											<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[extraIndex.index-1].diseaseExtraDiagName}">
											<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[extraIndex.index-1].isExtraMainCode}">
											<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName" value="${diseaseDiagInfo.damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[extraIndex.index-1].isExtraMainName}">
								
										</c:when>
										<c:otherwise>
											<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode">
											<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName">
											<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode">
											<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName">
								
										
										</c:otherwise>
									</c:choose>
									
								</c:forEach>
							</c:when>
							<c:otherwise>
								<c:forEach varStatus="extraIndex" begin="1" end="6" step="1">
									<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode">
									<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName">
									<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode">
									<input type="hidden" name="damageAndVenenationDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName">
								
								</c:forEach>
							</c:otherwise>
						</c:choose>
						
					</td>
					<td class="tdLabel_8">
						<a style="width: 50px;margin-right: 5px;" onclick="layerUpdateDamageDiag(this)" class="btn">编辑</a>
					</td>
				</tr> 
				<tr>
					<td class="tdLabel_8">
						<span class="pathologyDiagTypeShow" style="font-size: 10px">形态学编码</span>
						<input type="hidden" name="pathologyDiagRecords[0].diagTypeName" value="病理学诊断"/>
						<input type="hidden" name="pathologyDiagRecords[0].diagTypeCode" value="8"/>
					</td>
					<td class="tdLabel_8">
						<c:choose>
							<c:when test="${(not empty diseaseDiagInfo.pathologyDiagRecords) and  fn:length(diseaseDiagInfo.pathologyDiagRecords) > 0}">
								<c:if test="${(not empty diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagOriginalDesc) and (not empty diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagOriginalCode)  }">
									<c:set scope="page" var="pathologyDiagOriginalShow" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagOriginalCode }[${diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagOriginalDesc }]"></c:set>
								</c:if>
								
								<c:if test="${(not empty diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagOriginalDesc) and (empty diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagOriginalCode)  }">
									<c:set scope="page" var="pathologyDiagOriginalShow" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagOriginalDesc }"></c:set>
								</c:if>
								<span class="pathologyDiagOriginalShow">${pathologyDiagOriginalShow}</span>
								<input type="hidden" name="pathologyDiagRecords[0].diseaseDiagOriginalDesc" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagOriginalDesc }">
								<input type="hidden" name="pathologyDiagRecords[0].diseaseDiagOriginalCode" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagOriginalCode }">
							</c:when>
							<c:otherwise>
								<span class="pathologyDiagOriginalShow"></span>
								<input type="hidden" name="pathologyDiagRecords[0].diseaseDiagOriginalDesc">
								<input type="hidden" name="pathologyDiagRecords[0].diseaseDiagOriginalCode">
							</c:otherwise>
						</c:choose>
						
					</td>
					<td class="tdLabel_8">
						<c:choose>
							<c:when test="${(not empty diseaseDiagInfo.pathologyDiagRecords) and  fn:length(diseaseDiagInfo.pathologyDiagRecords) > 0}">
								
								<span class="pathologyDiagShow">${diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagCode }</span>
								<input type="hidden" name="pathologyDiagRecords[0].diseaseDiagName" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagName }">
								<input type="hidden" name="pathologyDiagRecords[0].diseaseDiagCode" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseDiagCode}">
							</c:when>
							<c:otherwise>
								<span class="pathologyDiagShow"></span>
								<input type="hidden" name="pathologyDiagRecords[0].diseaseDiagName">
								<input type="hidden" name="pathologyDiagRecords[0].diseaseDiagCode">
							</c:otherwise>
						</c:choose>
						
					</td>
					<td class="tdLabel_8" colspan="3">
						<c:choose>
							<c:when test="${(not empty diseaseDiagInfo.pathologyDiagRecords) and  fn:length(diseaseDiagInfo.pathologyDiagRecords) > 0}">
								<span class="pathologyNumberShow">病理号:${ diseaseDiagInfo.pathologyDiagRecords[0].pathologyNumber}</span>
								<input type="hidden" name="pathologyDiagRecords[0].pathologyNumber" value="${ diseaseDiagInfo.pathologyDiagRecords[0].pathologyNumber}">
							</c:when>
							<c:otherwise>
								<span class="pathologyNumberShow">病理号:</span>
								<input type="hidden" name="pathologyDiagRecords[0].pathologyNumber">
							</c:otherwise>
						</c:choose>
						<c:choose>
							<c:when test="${ fn:length(diseaseDiagInfo.pathologyDiagRecords) > 0}">
								<c:forEach varStatus="extraIndex" begin="1" end="6" step="1">
									<c:choose>
										<c:when test="${ fn:length(diseaseDiagInfo.pathologyDiagRecords[0].diseaseExtraDiagRecords) >= extraIndex.index}">
											<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseExtraDiagRecords[extraIndex.index-1].diseaseExtraDiagCode}">
											<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseExtraDiagRecords[extraIndex.index-1].diseaseExtraDiagName}">
											<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseExtraDiagRecords[extraIndex.index-1].isExtraMainCode}">
											<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName" value="${diseaseDiagInfo.pathologyDiagRecords[0].diseaseExtraDiagRecords[extraIndex.index-1].isExtraMainName}">
								
										</c:when>
										<c:otherwise>
											<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode">
											<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName">
											<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode">
											<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName">
								
										
										</c:otherwise>
									</c:choose>
									
								</c:forEach>
							</c:when>
							<c:otherwise>
								<c:forEach varStatus="extraIndex" begin="1" end="3" step="1">
									<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode">
									<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName">
									<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode">
									<input type="hidden" name="pathologyDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName">
								
								</c:forEach>
							</c:otherwise>
						</c:choose>
					</td>
					<td class="tdLabel_8">
						<a style="width: 50px;margin-right: 5px;" onclick="layerUpdatePathologyDiag(this)" class="btn">编辑</a>
					</td>
				</tr>
			</tfoot>
		</table>
	
	</div>
	
</form>

<table hidden="hidden">
	<tr id="templateDiseaseDiagTr">
		<td class="tdLabel_8">
			<!-- <input type="text" readonly="readonly" name="diseaseDiagRecords[0].diagTypeCode" value="其它诊断"/>
			<input type="hidden" name="diseaseDiagRecords[0].diagTypeName" value="A"/> -->
			<select name="diseaseDiagRecords[0].diagTypeCode" style="width: 100%">
			</select>
			<input type="hidden" name="diseaseDiagRecords[0].diagTypeName" />
		</td>
		<td class="tdLabel_8">
			<input type="text" name="diseaseDiagRecords[0].diseaseDiagOriginalDesc" style="width: 100%" readonly="readonly">
			<input type="hidden" name="diseaseDiagRecords[0].diseaseDiagOriginalCode">
		</td>
		<td class="tdLabel_8">
			<input class="input_box" data-type="diseaseDiag" type="text" name="diseaseDiagRecords[0].diseaseDiagShow">
			<input type="hidden" name="diseaseDiagRecords[0].diseaseDiagName">
			<input type="hidden" name="diseaseDiagRecords[0].diseaseDiagCode">
		</td>
		<td class="tdLabel_8">
			<select name="diseaseDiagRecords[0].inHospitalDiseaseStateCode" style="width: 100%">
			</select>
			<input type="hidden" name="diseaseDiagRecords[0].inHospitalDiseaseStateName">
		</td>
		<td class="tdLabel_8">
			<select name="diseaseDiagRecords[0].treatResultCode" style="width: 100%">
			</select>
			<input type="hidden" name="diseaseDiagRecords[0].treatResultName">
		</td>
		
		
		
		<td class="tdLabel_8">
			<input class="input_box" type="text" name="diseaseDiagRecords[0].diagSortIndex">
		</td>
		<td class="tdLabel_8">
			<a style="width: 50px;margin-right: 5px;" onclick="deleteDiseaseDiagRecord(this)" class="btn">删除</a>
		</td>
	</tr>
</table>


<div hidden="hidden">
<table>
<tr id="addDiagTr">
	<td class="tdLabel_8">
		<span class="otherDiagTypeShow"></span>
		<input type="hidden" name="diseaseDiagRecords[0].diagTypeName"/>
		<input type="hidden" name="diseaseDiagRecords[0].diagTypeCode"/>
		
	</td>
	<td class="tdLabel_8">
		<span class="ohterDiagOriginalDiagShow"></span>
		<input type="hidden" name="diseaseDiagRecords[0].diseaseDiagOriginalDesc">
		<input type="hidden" name="diseaseDiagRecords[0].diseaseDiagOriginalCode">
	</td>
	<td class="tdLabel_8">
		<span class="otherDiagShow"></span>
		<input type="hidden" name="diseaseDiagRecords[0].diseaseDiagName">
		<input type="hidden" name="diseaseDiagRecords[0].diseaseDiagCode">
	</td>
	<td class="tdLabel_8">
		<span class="otherDiagInHospitalDiseaseStateShow"></span>
		<input type="hidden" name="diseaseDiagRecords[0].inHospitalDiseaseStateCode">
		<input type="hidden" name="diseaseDiagRecords[0].inHospitalDiseaseStateName">
	</td>
	<td class="tdLabel_8">
		<span class="otherDiagTreatResultShow"></span>
		<input type="hidden" name="diseaseDiagRecords[0].treatResultCode">
		<input type="hidden" name="diseaseDiagRecords[0].treatResultName">
	</td>
	
	
	<td class="tdLabel_8">
		<span class="otherDiagSortIndex"></span>
		<input type="hidden" name="diseaseDiagRecords[0].diagSortIndex">
		<c:forEach varStatus="extraIndex" begin="1" end="6" step="1">
			<input type="hidden" name="diseaseDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagCode">
			<input type="hidden" name="diseaseDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].diseaseExtraDiagName">
			<input type="hidden" name="diseaseDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainCode">
			<input type="hidden" name="diseaseDiagRecords[0].diseaseExtraDiagRecords[${extraIndex.index-1}].isExtraMainName">
		</c:forEach>
	</td>
	<td class="tdLabel_8">
		<a style="width: 50px;margin-right: 5px;" onclick="deleteDiseaseDiagRecord(this)" class="btn">删除</a>
		
		<a style="width: 50px;margin-right: 5px;" title="edit" onclick="layerUpdateDiag(this)" class="btn">编辑</a>
		</td>
	</tr>
</table>
</div>



<div hidden="hidden" id="update_outpatient_diag_div">
	<form>
		<div class="search_table" style="width: 800px;">
		 <ul>
   
		    <li class="Label_1" style="width: 20%">医生诊断编码及描述：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<span class="outpatientOriginalDiagShow"></span>
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类主干码：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" type="text" name="outpatientDiagShow"/>
		    	<input type="hidden" name="outpatientDiagName">
				<input type="hidden" name="outpatientDiagCode">
		    </li>
		     <c:forEach begin="0" end="5" step="1" varStatus="status">
		     	<li class="Label_1" style="width: 20%">疾病分类附加码${status.index+1}：&nbsp;</li>
			    <li class="Label_2" style="width: 80%">
			    	<input class="input_box" data-type="allDiag" style="width: 80%" type="text" name="outpatientExtraDiag${status.index }Show"/>
			    	<input type="hidden" name="outpatientExtraDiag${status.index }Name">
					<input type="hidden" name="outpatientExtraDiag${status.index }Code">
					附加主干码：<input name="isExtraMain${status.index }Code" type="checkbox" value="1">
			    </li>
		     </c:forEach>
		    
		   	<li class="Label_5">
		     	<a onclick="layerUpdateOutpatientClick()">确认</a>
		    </li>
	    </ul>
	    </div>
	</form>
</div>

<div hidden="hidden" id="update_main_diag_div">
	<form>
		<div class="search_table" style="width: 800px;">
		 <ul>
   
		    <li class="Label_1" style="width: 20%">医生诊断编码及描述：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<span class="mainDiagOriginalDiagShow"></span>
		    		
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类主干码：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" type="text" name="mainDiagShow"/>
		    	<input type="hidden" name="mainDiagName">
				<input type="hidden" name="mainDiagCode">
		    </li>
		    <c:forEach begin="0" end="5" step="1" varStatus="status">
		    	<li class="Label_1" style="width: 20%">疾病分类附加码${status.index+1}：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="allDiag" style="width: 80%" type="text" name="mainExtraDiag${status.index }Show"/>
		    	<input type="hidden" name="mainExtraDiag${status.index }Name">
				<input type="hidden" name="mainExtraDiag${status.index }Code">
				附加主干码：<input name="isExtraMain${status.index }Code" type="checkbox" value="1">
		    </li>
		    
		    </c:forEach>
		    
		    
		     <!-- <li class="Label_1" style="width: 20%">疾病分类附加码2：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" style="width: 80%" type="text" name="mainExtraDiag1Show"/>
		    	<input type="hidden" name="mainExtraDiag1Name">
				<input type="hidden" name="mainExtraDiag1Code">
				附加主干码：<input name="isExtraMian1Code" type="checkbox" value="1">
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类附加码3：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" style="width: 80%" type="text" name="mainExtraDiag2Show"/>
		    	<input type="hidden" name="mainExtraDiag2Name">
				<input type="hidden" name="mainExtraDiag2Code">
				附加主干码：<input name="isExtraMian2Code" type="checkbox" value="1">
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类附加码4：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" style="width: 80%" type="text" name="mainExtraDiag3Show"/>
		    	<input type="hidden" name="mainExtraDiag3Name">
				<input type="hidden" name="mainExtraDiag3Code">
				附加主干码：<input name="isExtraMian3Code" type="checkbox" value="1">
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类附加码5：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" style="width: 80%" type="text" name="mainExtraDiag4Show"/>
		    	<input type="hidden" name="mainExtraDiag4Name">
				<input type="hidden" name="mainExtraDiag4Code">
				附加主干码：<input name="isExtraMian4Code" type="checkbox" value="1">
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类附加码6：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" style="width: 80%" type="text" name="mainExtraDiag5Show"/>
		    	<input type="hidden" name="mainExtraDiag5Name">
				<input type="hidden" name="mainExtraDiag5Code">
				附加主干码：<input name="isExtraMian5Code" type="checkbox" value="1">
		    </li> -->
		    <li class="Label_1" style="width: 20%">入院病情：&nbsp;</li>
		    <li class="Label_2" style="width: 30%">
		    	<select name="mainDiagRecord.inHospitalDiseaseStateCode" style="width: 90%">
				</select>
				<input type="hidden" name="mainDiagRecord.inHospitalDiseaseStateName">
			</li>
			<li class="Label_1" style="width: 20%">治疗结果：&nbsp;</li>
		    <li class="Label_2" style="width: 30%">
		    	<select name="mainDiagRecord.treatResultCode" style="width: 90%">
				</select>
				<input type="hidden" name="mainDiagRecord.treatResultName">
			</li>
			
		    <li class="Label_5">
		     <a onclick="layerUpdateMainClick()">确认</a>
		    </li>
	    </ul>
	    </div>
	</form>
</div>

<div hidden="hidden" id="create_diag_div">
	<form>
		<div class="search_table" style="width: 800px;">
		 <ul>
   			
		    <li class="Label_1" style="width: 20%">诊断类型：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<select name="otherDiag.diagTypeCode" style="width: 40%;float: left; margin-left:5px; margin-top: 4px;">
				</select>
				<input type="hidden" name="otherDiag.diagTypeName" />
		    		
		    </li>
		    <li class="Label_1" style="width: 20%">医生诊断编码及描述：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<span class="otherDiagShow"></span>
		    		
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类主干码：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" type="text" name="otherDiag.diagShow"/>
		    	<input type="hidden" name="otherDiag.diagName">
				<input type="hidden" name="otherDiag.diagCode">
		    </li>
		    <c:forEach begin="0" end="5" step="1" varStatus="status">
		    	 <li class="Label_1" style="width: 20%">疾病分类附加码${status.index+1}：&nbsp;</li>
			    <li class="Label_2" style="width: 80%">
			    	<input class="input_box" data-type="allDiag" style="width: 80%" type="text" name="otherExtraDiag${status.index }Show"/>
			    	<input type="hidden" name="otherExtraDiag${status.index }Name">
					<input type="hidden" name="otherExtraDiag${status.index }Code">
					附加主干码：<input name="isExtraMain${status.index }Code" type="checkbox" value="1">
			    </li>
		    	
		    </c:forEach>
		    <li class="Label_1" style="width: 20%">入院病情：&nbsp;</li>
		    <li class="Label_2" style="width: 30%">
		    	<select name="otherDiagRecord.inHospitalDiseaseStateCode" style="width: 90%">
				</select>
				<input type="hidden" name="otherDiagRecord.inHospitalDiseaseStateName">
			</li>
			<li class="Label_1" style="width: 20%">治疗结果：&nbsp;</li>
		    <li class="Label_2" style="width: 30%">
		    	<select name="otherDiagRecord.treatResultCode" style="width: 90%">
				</select>
				<input type="hidden" name="otherDiagRecord.treatResultName">
			</li>
			
			<li class="Label_1" style="width: 20%">序位：&nbsp;</li>
		    <li class="Label_2" style="width: 30%">
		    	
				<input class="input_box" style="width: 20%;float: left;margin-left: 10px;" type="text" name="otherDiag.diagSortIndex"/>
			</li>
		    <li class="Label_5">
		     <a onclick="layerCreateOtherDiagClick()">确认</a>
		    </li>
	    </ul>
	    </div>
	</form>
</div>

<div hidden="hidden" id="update_diag_div">
	<form>
		<div class="search_table" style="width: 800px;">
		 <ul>
   			
		    <li class="Label_1" style="width: 20%">诊断类型：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<select name="otherDiag.diagTypeCode" style="width: 40%;float: left; margin-left:5px; margin-top: 4px;">
				</select>
				<input type="hidden" name="otherDiag.diagTypeName" />
		    		
		    </li>
		    <li class="Label_1" style="width: 20%">医生诊断编码及描述：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<span class="otherDiagOriginalShow"></span>
		    		
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类主干码：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" type="text" name="otherDiag.diagShow"/>
		    	<input type="hidden" name="otherDiag.diagName">
				<input type="hidden" name="otherDiag.diagCode">
		    </li>
		    <c:forEach begin="0" end="5" step="1" varStatus="status">
		    	<li class="Label_1" style="width: 20%">疾病分类附加码${status.index+1}：&nbsp;</li>
			    <li class="Label_2" style="width: 80%">
			    	<input class="input_box" data-type="allDiag" style="width: 80%" type="text" name="otherExtraDiag${status.index }Show"/>
			    	<input type="hidden" name="otherExtraDiag${status.index }Name">
					<input type="hidden" name="otherExtraDiag${status.index }Code">
					附加主干码：<input name="isExtraMain${status.index }Code" type="checkbox" value="1">
			    </li>
		    </c:forEach>
		    
		    <li class="Label_1" style="width: 20%">入院病情：&nbsp;</li>
		    <li class="Label_2" style="width: 30%">
		    	<select name="otherDiagRecord.inHospitalDiseaseStateCode" style="width: 90%">
				</select>
				<input type="hidden" name="otherDiagRecord.inHospitalDiseaseStateName">
			</li>
			<li class="Label_1" style="width: 20%">治疗结果：&nbsp;</li>
		    <li class="Label_2" style="width: 30%">
		    	<select name="otherDiagRecord.treatResultCode" style="width: 90%">
				</select>
				<input type="hidden" name="otherDiagRecord.treatResultName">
			</li>
			<li class="Label_1" style="width: 20%">序位：&nbsp;</li>
		    <li class="Label_2" style="width: 30%">
		    	
				<input class="input_box" style="width: 20%;float: left;margin-left: 10px;" type="text" name="otherDiag.diagSortIndex"/>
			</li>
		    <li class="Label_5">
		     <a class="operateBtn" onclick="layerUpdateOtherDiagClick()">确认</a>
		    </li>
	    </ul>
	    </div>
	</form>
</div>

<div hidden="hidden" id="update_damage_diag_div">
	<form>
		<div class="search_table" style="width: 800px;">
		 <ul>
   
		    <li class="Label_1" style="width: 20%">医生诊断编码及描述：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<span style="width: 90%;" class="damageAndVenenationDiagOriginalShow"></span>
		    	<a onclick="clearDamageAndVenenationOriginalDiag(this)">清空</a>
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类主干码：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" type="text" name="damageAndVenenationDiagShow"/>
		    	<input type="hidden" name="damageAndVenenationDiagName">
				<input type="hidden" name="damageAndVenenationDiagCode">
		    </li>
		    <c:forEach begin="0" end="5" step="1" varStatus="status">
		    	<li class="Label_1" style="width: 20%">疾病分类附加码${status.index+1}：&nbsp;</li>
			    <li class="Label_2" style="width: 80%">
			    	<input class="input_box" data-type="allDiag" type="text" style="width: 80%" name="damageAndVenenationExtraDiag${status.index }Show"/>
			    	<input type="hidden" name="damageAndVenenationExtraDiag${status.index }Name">
					<input type="hidden" name="damageAndVenenationExtraDiag${status.index }Code">
					附加主干码：<input name="isExtraMain${status.index }Code" type="checkbox" value="1">
			    </li>
		    </c:forEach>
		    
		   	<li class="Label_5">
		     	<a onclick="layerUpdateDamageClick()">确认</a>
		    </li>
	    </ul>
	    </div>
	</form>
</div>

<div hidden="hidden" id="update_pathology_diag_div">
	<form>
		<div class="search_table" style="width: 800px;">
		 <ul>
   
		    <li class="Label_1" style="width: 20%">医生诊断编码及描述：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<span style="width: 90%;" class="pathologyDiagOriginalShow"></span>
		    	<a onclick="clearPathologyOriginalDiag(this)">清空</a>
		    	
		    </li>
		    <li class="Label_1" style="width: 20%">疾病分类主干码：&nbsp;</li>
		    <li class="Label_2" style="width: 80%">
		    	<input class="input_box" data-type="diseaseDiag" type="text" name="pathologyDiagShow"/>
		    	<input type="hidden" name="pathologyDiagName">
				<input type="hidden" name="pathologyDiagCode">
		    </li>
		    <c:forEach begin="0" end="5" step="1" varStatus="status">
		    	<li class="Label_1" style="width: 20%">疾病分类附加码${status.index+1}：&nbsp;</li>
			    <li class="Label_2" style="width: 80%">
			    	<input class="input_box" data-type="allDiag" style="width: 80%" type="text" name="pathologyExtraDiag${status.index }Show"/>
			    	<input type="hidden" name="pathologyExtraDiag${status.index }Name">
					<input type="hidden" name="pathologyExtraDiag${status.index }Code">
					附加主干码：<input name="isExtraMain${status.index }Code" type="checkbox" value="1">
			    </li>
		    </c:forEach>
		    <li class="Label_1" style="width: 20%">病理号：&nbsp;</li>
		    <li class="Label_2" style="width: 30%">
		    	
				<input class="input_box" style="width: 50%;float: left;margin-left: 10px;" type="text" name="pathologyNumber"/>
			</li>
		   	<li class="Label_5">
		     	<a onclick="layerUpdatePathologyClick()">确认</a>
		    </li>
	    </ul>
	    </div>
	</form>
</div>
<script>
	$(function(){
		var baseInfoJson= <%=baseInfoJson%>;
		var diseaseDiagInfoJson= <%=diseaseDiagInfoJson%>;
		var respondResultJson = <%=respondResultJson%>
		if(respondResultJson){
			if(respondResultJson.success){
				layer.msg("保存成功",{offset: '350px'});
			}else{
				layer.msg("保存失败",{offset: '350px'});
			}
		}
		console.log(baseInfoJson);
		console.log(diseaseDiagInfoJson);
		initPage(baseInfoJson,diseaseDiagInfoJson);
		
	});
</script>